import VueRouter from 'vue-router'

import Home from './components/tabbar/Home.vue'
import Cart from './components/tabbar/Cart.vue'
import Vip from './components/tabbar/Vip.vue'
import Search from './components/tabbar/Search.vue'
import NewsList from './components/news/NewsList.vue'
import NewsInfo from './components/news/newsinfo.vue'

//创建路由对象
var router = new VueRouter({
  routes: [
    {
      path:'/',
      redirect: Home
    },
    {
      path: '/home',
      component: Home
    },
    {
      path: '/vip',
      component: Vip
    }, {
      path: '/cart',
      component: Cart
    }, {
      path: '/search',
      component: Search
    },{
      path:'/home/newslist',
      component:NewsList
    },{
      path:'/home/newsinfo/:id',
      component:NewsInfo
    }
  ],
  linkActiveClass: 'mui-active'
})

// 把路由对象暴露出去
export default router